package com.imagecollector.config;

import com.imagecollector.common.properties.AliYunOssProperties;
import com.imagecollector.common.utils.AliOSSUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * <p>
 *
 * </p>
 *
 * @author ljx
 * @since 2024-06-21
 */

@Configuration
@Slf4j
public class AliYunOssConfiguration {
    /**
     * 创建并返回一个Alibaba Cloud OSS文件上传工具类对象
     *
     * @param aliYunOssProperties Alibaba Cloud OSS相关配置属性
     * @return 返回Alibaba Cloud OSS文件上传工具类对象
     */
    @Bean
    public AliOSSUtils aliOSSUtils(AliYunOssProperties aliYunOssProperties){
        log.info("正在创建阿里云OSS文件上传工具类对象：{}",aliYunOssProperties);
        AliOSSUtils aliOSSUtils=new AliOSSUtils();
        aliOSSUtils.setAliYunOssProperties(aliYunOssProperties);
        return aliOSSUtils;
    }
}
